<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title> 购物车 - <?=SITE_NAME?> </title>
<?php include VIEWS.'header.html'?>
</head>

<body>
<?php include VIEWS.'topbar.html'?>

<div id="content">
    <?php include VIEWS.'leftnav.html'?>

    <div id="right">
    <h1>购物车</h1>
    <div style="float:right" class="px12">&#8250; <script type="text/javascript">needHelp();</script><noscript><a href="<?php echo $_servername?>/forum/service/?from=shopcar" target="_blank">需要帮助？</a></noscript>&nbsp;&nbsp;</div>
    <div id="loading" style="display:none;padding-left:2em"><img src="/images/icon_indicator.gif" width="220" height="19" alt="Loading..."  /></div>
    <div class="updatemsg px12" id="updatemsg" style="width:75%;display:none;">&nbsp;</div>

<?php do_action('view_checkout_msg')?>

    <br clear="all" />

<?php if(count($list)):?>
    <div id="shopcar">
    <form action="/shopcar.php" method="post" id="updateform" onsubmit="javascript:return shopcar_edit();">
    <?php echo round_table('98%', '244890', 'white', 3, 3, 'top')?>
    <table cellpadding="2" width="98%" cellspacing="0" border="0">
    <tr style="background-color:#244890;color:#FFF;font-weight:bold"><td>&nbsp;物品名称</td><td>数量</td><td>价格</td><td>移除</td></tr>

<?php foreach($list as $v):$shopcar_i++;?>
    <tr style="background-color:<?php echo $shopcar_i%2==0 ? '#F9F9F9' : '#EEEEEE'?>"><td style="padding:10px"><a href="/items/<?php echo $v['iid']?>" target="_blank"><?php echo $v['iname']?></a></td><td width="20%"><input tabindex="1" maxlength="3" id="amount<?php echo $v['id']?>" name="amount<?php echo $v['id']?>" size="1" type="text" value='<?php echo $v['amount']?>'> × <?php echo $v['price']?></td><td width="10%">&yen; <span id="price<?php echo $v['id']?>"><?php echo $v['amount']*$v['price']?></span></td><td width="10%"><input type="checkbox" value="0" name="amount<?php echo $v['id']?>" /></td></tr>
<?php endforeach?>

<?php do_action('view_shopcar_list_itemlist_after', array('list'=>&$list));?>

    <tr><td colspan="4" style="border-top:1px dotted #244890"><img width="1" height="1" alt="" /></td></tr>
    <tr style="font-weight:bold"><td style="padding-left:10px">小计：</td><td><span id="totalamount"><?php echo $totalamount?></span></td><td>&yen; <span id="totalprice"><?php echo $totalprice?></span></td></tr>
    </table>

    <br />
    <input type="hidden" name="emptycar" id="emptycar" value="0" />&nbsp;
    <input tabindex="2" class="bluebtn" id="submit" type="submit" value="更新购物车" />&nbsp;
    <!--<input tabindex="2" class="darkbtn" id="emptycarbtn" type="submit" value="清空购物车" onclick="javascript:$('updateform').emptycar.value=1" />&nbsp;-->
    <input style="font-weight:bold" tabindex="2" class="redbtn" id="checkout" type="button" value="下一步，提交订单" onclick="javascript:location.href='/checkout'" />
    </form>

    <noscript><br /><br /><b class="px12">由于您的机器不支持Javascript</b><br /><br /><a href="/shopcar?emptycar=1">请点击这里清空您的购物车</a>，<a href="/checkout">点击这里提交您的订单</a></noscript>
</div>

<?php do_action('view_shopcarlist_after')?>

<?php else:?>
    <div class="errbox roundNormal">&nbsp;&nbsp;&nbsp;您的购物车中没有任何物品，为何不看看我们的 <a href="/whathot" class="white">热门物品</a>?</div>
<?php endif?>

    </div>
</div>

<?php include VIEWS.'copyright.html'?>

</body>
</html>
